#ifndef _DSWALARMCENTER_H
#define _DSWALARMCENTER_H
#include <libbase/dswbase.h>

class CDswalarmcenter : public CDswbase
{
public:
	CDswalarmcenter(LPST_ENV_T pEnv);
	virtual ~CDswalarmcenter();
private:
	LPST_ALARM_NODE_T GetAlarmNode(LPLIST_ST_ALARM_NODE_T pList);
	void CreateAlarmNode(LPST_ALARM_NODE_T pAlarmTrig);
	static void cbAlarmProcessTask(int fd, short events, void* ctx){((CDswalarmcenter*)ctx)->AlarmProcessTask(fd, events);};
	void AlarmProcessTask(int fd, short events);
	void ProcessAlarmSnd(LPST_ALARM_NODE_T pNode);
	void ProcessNetLD(LPST_ALARM_NODE_T pNode);
	void ProcessPTZLD(LPST_ALARM_NODE_T pNode);
	void ProcessCap(LPST_ALARM_NODE_T pNode);
	void ProcessMsgAlm(LPST_ALARM_NODE_T pNode);
protected:
	virtual int OnMessage(EN_MSG_TYPE nMsgType, void * pParam);
private:
	pthread_mutex_t m_nAlarm_Lock;
	LIST_ST_ALARM_NODE_T m_nAlarmList_UnUsed;
	HashTable* m_pAlarmChkTab;
	ST_TIMER_PARAM_T m_nAlarmTask;
};

#endif

